package org.example.design.designmode.combination.coursedemo;

/**
 * @author songyafei
 */
public class Course extends CourseComent{

    private  String name;
    private  double price;

    public Course(String name, double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String getName(CourseComent c) {
        return this.name;
    }

    @Override
    public double getPrice(CourseComent c) {
        return this.price;
    }

    @Override
    public void print() {
       System.out.println(name+"($"+price+")元");
    }
}
